package com.elec.controller.front;

import com.elec.domain.R;
import com.elec.domain.entity.ElectricityBill;
import com.elec.domain.entity.PaymentRecord;
import com.elec.service.ElectricityBillService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author yu
 * @date 2024/7/7
 */
@RestController
@RequestMapping("front/bill")
public class FrontBillController {
    @Resource
    private ElectricityBillService electricityBillService;
    @GetMapping("getMyBill")
    public R getMyBill(@RequestParam(defaultValue = "1") Integer pageNum,
                       @RequestParam(defaultValue = "10") Integer pageSize,
                       ElectricityBill electricityBill) {
        return electricityBillService.getMyBill(pageNum, pageSize, electricityBill);
    }

    @PostMapping("pay")
    public R pay(@RequestBody PaymentRecord paymentRecord){
        return electricityBillService.pay(paymentRecord);
    }

}
